# 使用YOLO检测车牌
from ultralytics import YOLO
det_model = YOLO("runs/detect/train14/weights/best.pt")  # 自定义车牌检测模型

plate_boxes = det_model(r"K:\1-YolotrainPic\CCPD\CCPD_1\images\test\00336805555555-90_91-306&501_412&542-407&539_310&538_310&504_407&505-0_0_10_17_26_31_33-114-13.jpg")

# 使用PaddleOCR识别字符
from paddleocr import PaddleOCR
rec_model = PaddleOCR(lang='ch', use_angle_cls=True)
text = rec_model(plate_boxes[0].crop())
print(text)